/*
 * Copyright 2011-2011 Tiago da Fonseca Frazao  All rights reserved.
 */
package mz.co.framework.error;

import java.util.ResourceBundle;

/**
 * @author Tiago da Fonseca Frazao
 */
public abstract class AbstractException extends Exception {

	/**
	 * SerialVersionUID
	 */
	private static final long serialVersionUID = 1L;

	private int key;

	private ResourceBundle bundle = ResourceBundle.getBundle(getBaseName());

	public AbstractException(int key) {
		this.key = key;
	}

	public AbstractException(int key, Throwable cause) {
		super(cause);
		this.key = key;
	}

	public abstract String getBaseName();

	public String getMessage() {
		return bundle.getString(String.valueOf(key));
	}

}
